/******************************************************************************* * Copyright (c) 2000, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.swt.widgets; import org.eclipse.swt.SWT; import org.eclipse.swt.SWTException; import org.eclipse.swt.graphics.Rectangle; /** * This class is the abstract superclass of all classes which represent controls * that have standard scroll bars. * <dl> * <dt><b>Styles:</b></dt> * <dd>H_SCROLL, V_SCROLL</dd> * <dt><b>Events:</b> * <dd>(none)</dd> * </dl> * <p> * IMPORTANT: This class is intended to be subclassed <em>only</em> within the * SWT implementation. * </p> * * @see <a href="http://www.eclipse.org/swt/">Sample code and further * information</a> * @noextend This class is not intended to be subclassed by clients. */ public abstract class Scrollable extends Control { /** * Constructs a new instance of this class given its parent and a style * value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in class * <code>SWT</code> which is applicable to instances of this class, or must * be built by <em>bitwise OR</em>'ing together (that is, using the * <code>int</code> "|" operator) two or more of those <code>SWT</code> * style constants. The class description lists the style constants that are * applicable to the class. Style bits are also inherited from superclasses. * </p> * * @param parent * a composite control which will be the parent of the new * instance (cannot be null) * @param style * the style of control to construct * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the parent</li> * <li>ERROR_INVALID_SUBCLASS - if this class is not an * allowed subclass</li> * </ul> * * @see SWT#H_SCROLL * @see SWT#V_SCROLL * @see Widget#checkSubclass * @see Widget#getStyle */ public Scrollable(Composite parent, int style) { super(parent, style); } /** * Given a desired <em>client area</em> for the receiver (as described by * the arguments), returns the bounding rectangle which would be required to * produce that client area. * <p> * In other words, it returns a rectangle such that, if the receiver's * bounds were set to that rectangle, the area of the receiver which is * capable of displaying data (that is, not covered by the "trimmings") * would be the rectangle described by the arguments (relative to the * receiver's parent). * </p> * * @param x * the desired x coordinate of the client area * @param y * the desired y coordinate of the client area * @param width * the desired width of the client area * @param height * the desired height of the client area * @return the required bounds to produce the given client area * * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> * * @see #getClientArea */ public Rectangle computeTrim(int x, int y, int width, int height) { // TODO return new Rectangle(0, 0, 0, 0); } /** * Returns a rectangle which describes the area of the receiver which is * capable of displaying data (that is, not covered by the "trimmings"). * * @return the client area * * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> * * @see #computeTrim */ public Rectangle getClientArea() { // TODO return new Rectangle(0, 0, 0, 0); } /** * Returns the receiver's horizontal scroll bar if it has one, and null if * it does not. * * @return the horizontal scroll bar (or null) * * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public ScrollBar getHorizontalBar() { // TODO return null; } /** * Returns the mode of the receiver's scrollbars. This will be * <em>bitwise</em> OR of one or more of the constants defined in class * <code>SWT</code>.<br> * <li><code>SWT.SCROLLBAR_OVERLAY</code> - if receiver uses overlay * scrollbars</li> <li><code>SWT.NONE</code> - otherwise</li> * * @return the mode of scrollbars * * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> * * @see SWT#SCROLLBAR_OVERLAY * * @since 3.8 */ public int getScrollbarsMode() { // TODO return 0; } /** * Returns the receiver's vertical scroll bar if it has one, and null if it * does not. * * @return the vertical scroll bar (or null) * * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public ScrollBar getVerticalBar() { // TODO return null; } }